package hcn.protocol.brandnew.dengji.bingli;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 健康记录列表查询-响应消息(成功） - ODS_02100003_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class HealthRecordsListResponse {

    /**
     * 健康记录List
     */
    @XmlElementWrapper(name = "RecordsLists")
    @XmlElement(name = "RecordsList")
    private List<RecordsList> recordsLists;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class RecordsList {

        /**
         * 就诊日期
         */
        @XmlElement(name = "VisitDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date visitDateTime;
        /**
         * 患者在医院的唯一识别号
         */
        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 患者费用性质代码
         */
        @XmlElement(name = "PatientProperties")
        private String patientProperties;
        /**
         * 年龄
         */
        @XmlElement(name = "PatientAge")
        private String patientAge;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 床位号
         */
        @XmlElement(name = "SickbedId")
        private String sickbedId;
        /**
         * 就诊医疗机构组织机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 就诊机构名称
         */
        @XmlElement(name = "OrganizationName")
        private String organizationName;
        /**
         * 科室代码
         */
        @XmlElement(name = "VisitDeptId")
        private String visitDeptId;
        /**
         * 科室名称
         */
        @XmlElement(name = "VisitDeptName")
        private String visitDeptName;
        /**
         * 责任医师代码
         */
        @XmlElement(name = "ResponsibilityDoctorId")
        private String responsibilityDoctorId;
        /**
         * 责任医师姓名
         */
        @XmlElement(name = "ResponsibilityDoctor")
        private String responsibilityDoctor;
        /**
         * 门诊类型
         */
        @XmlElement(name = "OutpatientType")
        private String outpatientType;
        /**
         * 门诊类型名称
         */
        @XmlElement(name = "OutpatientTypeName")
        private String outpatientTypeName;
        /**
         * 疾病诊断编码
         */
        @XmlElement(name = "DiagnoseCode")
        private String diagnoseCode;
        /**
         * 疾病诊断名称
         */
        @XmlElement(name = "DiagnoseName")
        private String diagnoseName;
        /**
         * 患者类型代码
         */
        @XmlElement(name = "PatientType")
        private String patientType;
        /**
         * 就诊序号
         */
        @XmlElement(name = "VisitId")
        private String visitId;
        /**
         * 门诊号码
         */
        @XmlElement(name = "ClinicId")
        private String clinicId;
        /**
         * 住院号
         */
        @XmlElement(name = "HospizationId")
        private String hospizationId;

        // 药物过敏
        @XmlElementWrapper(name = "MedicalAllergyLists")
        @XmlElement(name = "MedicalAllergyList")
        private List<Allergy> MedicalAllergyList;

        // 其他过敏
        @XmlElementWrapper(name = "OtherAllergyLists")
        @XmlElement(name = "OtherAllergyList")
        private List<Allergy> OtherAllergyList;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Allergy{

        /**
         * 过敏源代码
         */
        @XmlElement(name = "AllergenicIngredientsCode")
        private String allergenicIngredientsCode;

        @XmlElement(name = "AllergenicIngredients")
        private String allergenicIngredients;

        @XmlElement(name = "AllergicSymptoms")
        private String allergicSymptoms;

        @XmlElement(name = "AllergySeverity")
        private String allergySeverity;

        @XmlElement(name = "AllergyType")
        private String allergyType;
    }

}
